<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<script type="text/javascript" src="rp/scripts/goouploader/codebase/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="rp/scripts/goouploader/goouploader-init.js"></script>
	
	<script type="text/javascript">
    	var uploaderDiv;
    	
    	/*
    		注意：这些参数都不能删除，否则将无法正常上传文件
    		saveToDb：是否需要将上传的文件信息保存至数据库，默认保存
    		webSaveDirPath: 保存上传文件的目录路径，如果为0，则使用平台配置默认保存路径
    		fileRename：是否在后台对文件进行重命名，默认为true
    		customOperaImpl：是否需要执行自定义操作，默认不执行，如果需要执行，需要传入实现类Bean的名称
    		entityName：上传文件对应的实体类名
    		entityId：上传文件对应的实体类ID
    	 */
    	var params = {
  				"saveToDb":"false", 
  				"webSaveDirPath":"0", 
  				"fileRename":"true",
  				"customOperaImpl":"0",
  				"entityName":"", 
  				"entityId":""};
    	
    	var property={
   	    		width:600,
   	    		height:250,
   	    		multiple:true,
   	    	    file_types:"*.jpg;*.gif;*.avi;*.mkv",
   	    	    file_types_description: "支持上传的文件格式",
   	    	    post_params:params,
   	    	    btn_add_text:"添加",
   	    	    btn_up_text:"上传",
   	    	    btn_cancel_text:"放弃",
   	    	    btn_clean_text:"清空",
   	    	    op_del_text:"单项删除",
   	    	    op_up_text:"单项上传",
   	    	    op_fail_text:"上传失败",
   	    	    op_ok_text:"上传成功",
   	    	    op_no_text:"取消上传",
   	    	 	file_size_limit: 0,//文件大小限制，单位为KB，0表示大小无限制
				file_upload_limit: 0,//允许上传的文件数量,0表示无限制,如果需要单文件上传，则设成1即可
				file_queue_limit: 0,
   	    		upload_url:"<%= basePath %>/servlet/goouploadFile"
   	    	};
    	
    	$(function(){
    		
    		uploaderDiv = jq132.createGooUploader($("#uploaderDiv"),property);
    	});
    	
    	//上传方法
    	function gooupload(){
    		//添加参数
    		uploaderDiv.$swfUpload.addPostParam("","");
    		uploaderDiv.$btn_upload.click();
    	}
    	
    </script>

  </head>
  
  <body>
    <div id="uploaderDiv" style="display: block;"></div>
    <input type="button" value="上传" onclick="gooupload();"/>
    <!-- <input type="button" value="取上传文件列表" onclick="getFiles();"/>
    <input type="button" value="获取结果" onclick="getResult();"/> -->
  </body>
</html>
